Skip to content

feat(webserver): 允许禁用 Web 服务#253

Merged
MistEO merged 2 commits into
MistEO:mainfrom
litwak913:disable-webserver
Jun 29, 2026
Merged

feat(webserver): 允许禁用 Web 服务#253
MistEO merged 2 commits into
MistEO:mainfrom
litwak913:disable-webserver

Conversation

@litwak913

@litwak913 litwak913 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Close #248

Summary by Sourcery

添加一个可配置的开关,用于启用或禁用内置 Web 服务器,并通过设置、后端启动流程和系统信息进行串联。

New Features:

  • 引入一个 Web 服务器启用/禁用设置,将其持久化到应用配置中,并通过设置存储和 UI 对外暴露。

Enhancements:

  • 更新 Tauri 后端,使其在启动服务器以及报告端口时遵循 Web 服务器启用标志;当 Web 服务器被禁用时返回端口 0。
  • 为 Web 服务器启用开关在所有受支持的语言中添加本地化标签和提示文本。
Original summary in English

Summary by Sourcery

Add a configurable toggle to enable or disable the built-in web server and wire it through settings, backend startup, and system info.

New Features:

  • Introduce a Web server enable/disable setting persisted in app configuration and exposed via the settings store and UI.

Enhancements:

  • Update the Tauri backend to honor the Web server enabled flag when starting the server and when reporting its port, returning 0 if disabled.
  • Add localized labels and hints for the Web server enable toggle across supported languages.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些整体反馈:

  • 新增的 AppSettingsAppState 中的 webServerEnabled 字段与周围属性的缩进不一致;将它们的缩进与相邻字段对齐,可以让类型定义更加一致,也更容易浏览。
  • DebugSection 中,当 webServerEnabled 为 false 时,你可以考虑禁用或在视觉上弱化端口和局域网访问控制,这样用户就能理解在 Web 服务器关闭时这些设置是处于不生效状态的。
供 AI 代理使用的提示
Please address the comments from this code review:

## Overall Comments
- The newly added `webServerEnabled` fields in `AppSettings` and `AppState` are indented differently from surrounding properties; aligning their indentation with adjacent fields will keep the type definitions consistent and easier to scan.
- In `DebugSection`, when `webServerEnabled` is false you might consider disabling or visually de-emphasizing the port and LAN access controls so users understand those settings are inactive while the web server is turned off.

Sourcery 对开源项目免费——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English

Hey - I've left some high level feedback:

  • The newly added webServerEnabled fields in AppSettings and AppState are indented differently from surrounding properties; aligning their indentation with adjacent fields will keep the type definitions consistent and easier to scan.
  • In DebugSection, when webServerEnabled is false you might consider disabling or visually de-emphasizing the port and LAN access controls so users understand those settings are inactive while the web server is turned off.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The newly added `webServerEnabled` fields in `AppSettings` and `AppState` are indented differently from surrounding properties; aligning their indentation with adjacent fields will keep the type definitions consistent and easier to scan.
- In `DebugSection`, when `webServerEnabled` is false you might consider disabling or visually de-emphasizing the port and LAN access controls so users understand those settings are inactive while the web server is turned off.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MistEO MistEO merged commit 453bd25 into MistEO:main Jun 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

允许不开启Web服务器

2 participants